package ar.com.solidussource.howmuchservices.common.entities.filter;

import org.hibernate.Criteria;
import org.hibernate.criterion.Restrictions;

import ar.com.solidussource.framework.backend.dao.filter.OrderedFilter;

public class ProductsubcategoryFilter extends OrderedFilter {
	private Integer productcategoryId;
	
	public Integer getProductcategoryId() {
		return productcategoryId;
	}

	public void setProductcategoryId(Integer productcategoryId) {
		this.productcategoryId = productcategoryId;
	}

	@Override
	public void fillCriteriaNotPagination(Criteria arg0) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void fillCriteriaNoOrder(Criteria criteria) {
		if (getProductcategoryId() != null) {
			criteria.add(Restrictions.eq("productcategory.id", this.productcategoryId));
		}
	
	}
}
